<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

function base(num) {
    let stack = []
    let str = ''
    while(num>=2){
        if(num%2==0){
            stack.push(0)
        }else{
            stack.push(1)
        }
        num = Math.floor(num/2)
    }
    if(num%2==0){
        stack.push(0)
    }else{
        stack.push(1)
    }
    while(stack.length){
        str = str + stack.pop()
    }
    return str
}

let num = 100
console.log(base(num))

    </script>
</body>
</html>